import csv
import json

py_dict = {}

# convert json file to python dictionary
with open('employee.json', 'r', encoding='utf-8') as file_obj:
    py_dict = json.load(file_obj)

# convert write python dictionary to csv
with open('employees_records.csv', 'w', encoding='utf-8', newline='') as file_obj:
    csv_writer = csv.DictWriter(file_obj, fieldnames=py_dict['10001'].keys())
    csv_writer.writeheader()
    for key in py_dict.keys():
        csv_writer.writerow(py_dict[key])